# jsb/version.py
#
#

""" version related stuff. """

## jsb imports

from jsb.lib.datadir import getdatadir

## basic imports

import os
import binascii

## defines

version = "0.8 BETA1"

## getversion function

def getversion(txt=""):
    """ return a version string. """
    try:
        from jsb.lib.config import getmainconfig
        config = getmainconfig()
        if not config.nodb: dbtype = config.dbtype.upper()
        else: dbtype = "NODB"
    except: dbtype = ""
    try:
        from jsb.lib.datadir import getdatadir
        ddir = getdatadir()
    except: ddir = ""
    return "JSONBOT %s %s %s" % (version, dbtype, txt)

def getversionfull(txt=""):
    ddir = getdatadir()
    return getversion(txt + " running from " + ddir)